package org.gten.gegedexin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author Eric
 * @date 2023/6/9
 * mail_info表记录和邮件有关的信息
 * mail_id 标识邮件的id。 -- 主键
 * sender 发件方username
 * header 邮件标题
 * receiver 收件方username
 * date 发件日期
 * is_read 是否已读
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "mail_info")
public class MailInfoPojo {
//    public MailInfoPojo(int mail_id, String contextFilepath, String sender, String receiver, String date, int is_read){
//        this.mailId = mail_id;
//        this.contextFilepath = contextFilepath;
//        this.sender = sender;
//        this.receiver = receiver;
//        this.date = date;
//        this.isRead = is_read;
//    }
//
//    public MailInfoPojo (String contextFilepath, String sender, String receiver, String date){
//        this.contextFilepath = contextFilepath;
//        this.sender = sender;
//        this.receiver = receiver;
//        this.date = date;
//    }
//
    // 邮件id
    @TableId(value = "mail_id",type = IdType.NONE)
    private int mailId;

    // 邮件标题
    @TableField(value = "header")
    private String header;

    // 发送方username
    @TableField(value = "sender")
    private String sender;

    // 接收方username
    @TableField(value = "receiver")
    private String receiver;
    @TableField(value = "date")
    private String date;

    // 邮件状态：已读/未读
    @TableField(value = "is_read")
    private int isRead;

    public void setMailId(int mailId) {
        this.mailId = mailId;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }



    public void setDate(String date) {
        this.date = date;
    }

    public void setIsRead(int isRead) {
        this.isRead = isRead;
    }

    public void setDelDate(LocalDateTime delDate) {
        this.delDate = delDate;
    }

    // 删除日期
    @TableField(value = "del_date")
    private LocalDateTime delDate;

    @Override
    public String toString() {
        return "MailInfoPojo{" +
                "mailId=" + mailId +
                ", header='" + header + '\'' +
                ", sender='" + sender + '\'' +
                ", receiver='" + receiver + '\'' +
                ", date='" + date + '\'' +
                ", isRead=" + isRead +
                ", delDate=" + delDate +
                '}';
    }
}
